(function(){
        var myChart=echarts.init(document.getElementById('right3'));
        var option = {
                  grid: {left:'5%',
                         right:'5%',
                         top:'20%',
                         bottom:'5%',
                         containLabel:true
                         },
                  title: {text: '现金流收入排名',
                          textStyle: {color:"#21e6c1",fontSize: 18,fontFamily:"楷体"},
                          left:'12%',
                          top:'5%'},
                  tooltip: {
                          trigger: 'axis',
                          axisPointer: {type: 'shadow'}
                            },
                   xAxis: {
                           type: 'value',
                           boundaryGap: [0, 0.01],
                           axisLabel:{fontSize: 8,color:"white"},
                           splitLine:{show: false}
                           },
                   yAxis: {
                           type: 'category',
                           data: [],
                           axisLabel:{fontSize: 8,color:"white"},
                           splitLine:{show: false}
                            },
                    series: [
                             {
                              name: '2025年',
                              type: 'bar',
                              data: [],
                              itemStyle: {normal: {label: {show: true,position: 'right',textStyle: {color: "white",fontSize: 8}},
                                 color:"#43dde6"}
                        }
                              } 
                              ]
                             };

        function get_json_bar() {
    $.ajax({
        url: 'http://localhost:5000/right3',
        type: 'GET',
        success: function (e) {
        option.yAxis.data = e.map(subArray => subArray[0]);
        option.series[0].data = e.map(subArray => subArray[1]);
        myChart.setOption(option);
        setTimeout(get_json_bar,10000)
                               }
            });
}
//执行函数
get_json_bar();

          myChart.setOption(option);
})();